<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function getArrValue(arr = []) {
            let max = arr[0]
            let min = arr[0] 
            for (let i = 1; i < arr.length; i++) {
                if (max < arr[i]) {
                    max = arr[i]
                }
                if (min > arr[i]) {
                    min = arr[i]
                }
            }
            return [max, min]
        }
        let newArr = getArrValue([1, 3, 5, 7, 9])
        console.log(`数组的最大值max是：${newArr[0]}`);
        console.log(`数组的最小值min是：${newArr[1]}`);
    </script>
</body>
</html>